""" Qt drag and drop files helper """

def setup_drag_and_drop(window, callback):

    def dragEnterEvent(event):
        event.accept()

    def dropEvent(event):
        for url in event.mimeData().urls():
            callback(url.toLocalFile())
        
    window.dragEnterEvent = dragEnterEvent
    window.dropEvent = dropEvent
    window.setAcceptDrops(True)

